﻿@{
    Layout = null;

    string modelReference = null;

    if (ViewBag.Project.ViewEngine != ViewEngine.WebForms)
    {
        if (!string.IsNullOrWhiteSpace(Page.Model))
        {
            modelReference = SampleHelper.VaryByLanguage("<" + Page.Model + ">", "(Of " + Page.Model + ")").ToString();
        }        
    }
}
@if (ViewBag.Project.ViewEngine == ViewEngine.WebForms)
{
@:<%@@ Page Language="@SampleHelper.VaryByLanguage("C#", "VB")" MasterPageFile="~/Shared/Site.Master" AutoEventWireup="true" CodeBehind="@(PageData["CodeBehind"]).aspx.@ViewBag.Project.Language.ToString().ToLower()" Inherits="@PageData["Inherits"]" EnableViewState="false" Title="@PageData["Title"]" %>
}
else if (ViewBag.Project.ViewEngine == ViewEngine.Mvc)
{
@:<%@@ Page Language="@SampleHelper.VaryByLanguage("C#", "VB")" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage@(Html.Raw(modelReference))" EnableViewState="false" Title="@PageData["Title"]" %>
}
else
{
    if (ViewBag.Project.Language == CodeLanguage.Cs)
    {
        if (!string.IsNullOrWhiteSpace(Page.Model))
        {
        @:@@model @Page.Model
    }
    
    <text>@@using Krystalware.SlickUpload;
@@using Krystalware.SlickUpload.Web;
@@using Krystalware.SlickUpload.Web.Mvc;

@@{
    Layout = "~/Views/Shared/_Layout.cshtml";
    ViewBag.Title = "@PageData["Title"]";
}
</text>
    }
    else
    {
        if (!string.IsNullOrWhiteSpace(Page.Model))
        {
        @:@@Model @Page.Model
    }
    
    <text>@@Imports Krystalware.SlickUpload
@@Imports Krystalware.SlickUpload.Web
@@Imports Krystalware.SlickUpload.Web.Mvc

@@Code
    Layout = "~/Views/Shared/_Layout.vbhtml"
    ViewBag.Title = "@PageData["Title"]"
End Code
</text>        
    }
}
@if (ViewBag.Project.ViewEngine == ViewEngine.WebForms || ViewBag.Project.ViewEngine == ViewEngine.Mvc)
{
@:<%@@ Import Namespace="Krystalware.SlickUpload" %>
}
@if (ViewBag.Project.ViewEngine == ViewEngine.Mvc)
{
@:<%@@ Import Namespace="Krystalware.SlickUpload.Web" %>
@:<%@@ Import Namespace="Krystalware.SlickUpload.Web.Mvc" %>
}
@if (ViewBag.Project.ViewEngine == ViewEngine.WebForms && PageData["RegisterSlickUpload"] == true)
{
@:<%@@ Register TagPrefix="kw" Assembly="Krystalware.SlickUpload" Namespace="Krystalware.SlickUpload.Web.Controls" %>
}